package cn.yitun.chat.yitunserverimcore.general.common.util;

import cn.yitun.chat.yituncommonmessage.impl.HeadImpl;
import cn.yitun.chat.yituncommonmessage.push.PushMessage;

/**
 * @author yitun
 * @date 2019-02-17
 */
public class PushMessageBuild {

	public static PushMessage build(String action, String method) {
		Long key = System.nanoTime();
		return build(key, action, method);
	}

	public static PushMessage build(Long key, String action, String method) {
		PushMessage message = new PushMessage();

		HeadImpl head = new HeadImpl();
		head.setAction(action);
		head.setMethod(method);
		head.setKey(key);
		head.setTimestamp(System.currentTimeMillis());
		message.setHead(head);

		return message;
	}
}